/**
 * @param {HTMLElement} el
 * @returns {Object}
 */
export function getElementSize(el: HTMLElement): { width: number; height: number } {
  if (!el) return { width: 0, height: 0 }
  try {
    const rect = el.getBoundingClientRect()
    return {
      width: rect.width,
      height: rect.height
    }
  } catch (e) {
    return { width: 0, height: 0 }
  }
} 